package game.block.trap;

import game.block.Locator;
import game.block.command.Command;
import game.block.command.RemoveCommand;
import game.block.entity.MovableEntity;
import game.block.entity.TrapEntity;
import game.block.game.Board;
import game.block.tile.Tile;
import game.block.turn.Turn;

import com.badlogic.gdx.math.Vector2;

public class Hole extends TrapEntity {

    public Hole(Vector2 pos, Tile tile) {
        super(pos, tile, HOLE, TRAPTYPE.HOLE);
    }

    @Override
    public Command advance() {
        return null;
    }

    @Override
    public void applyEffect(MovableEntity block, Board gameBoard, Turn currentTurn, Tile tileMovedTo) {
        if (!block.counterEffect(this)) {
        	Locator.getAudio().playSound(SOUND.HOLE.getValue());
            currentTurn.addCommand(new RemoveCommand(block, currentTile, gameBoard));
        }
    }

    @Override
    public Command retract() {
        return null;
    }
    
    @Override
	public void setInfo() {
		info="Name:  Hole Trap\n\nFunction:  Destroys a block";
	}

}
